﻿namespace MyTodo.Shared.Services;

/// <summary>
/// Api接口通用结果返回
/// </summary>
public class ApiResponse
{
    public ApiResponse(string message, bool status = false)
    {
        Message = message;
        Status = status;
    }
    public ApiResponse(bool status, object? result = null)
    {
        Status = status;
        Result = result;
    }
    public string Message { get; set; } = string.Empty;
    public bool Status { get; set; }
    public object? Result { get; set; }
}

public class ApiResponse<T>
{
    public ApiResponse()
    {

    }
    public ApiResponse(string message, bool status = false)
    {
        Message = message;
        Status = status;
    }
    public ApiResponse(bool status, T? result)
    {
        Status = status;
        Result = result;
    }
    public string Message { get; set; } = string.Empty;
    public bool Status { get; set; }
    public T? Result { get; set; }
}